<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="https://unpkg.com/better-scroll@1.0.1/dist/bscroll.min.js"></script>
    <title>Document</title>
</head>
<body>
    <!-- http://ustbhuangyi.github.io/better-scroll/doc/zh-hans/installation.html#script-%E5%8A%A0%E8%BD%BD -->
    <!-- https://www.jianshu.com/p/ccc8d4823438 -->
    <!-- https://blog.csdn.net/weixin_37719279/article/details/82084342 -->


    <div class="wrapper"> 
        <ul class="content" id="ul"> 
        <li>1</li> 
        <li>2</li>
        <li>3</li> 
        <li>4</li>
        <li>1</li> 
        <li>2</li>
        <li>1</li> 
        <li>2</li>
        <li>1</li> 
        <li>2</li>
        <li>1</li> 
        <li>2</li>
        <li>1</li> 
        <li>2</li>
        <li>3</li> 
        <li>4</li>
        <li>1</li> 
        <li>2</li>
        <li>1</li> 
        <li>2</li>
        <li>1</li> 
        <li>2</li>
        <li>1</li> 
        <li>2</li>
        <li>3</li>
         
         </ul>
    </div>


</body>
<script>
    // var ul=document.getElementById("ul")
    // var lis=ul.getElementsByTagName('li')
    // for(let i=0;i<lis.length;i++){
    //     lis[i].style.left=i*80 +"px"
    // }
    // https://better-scroll.github.io/docs/zh-CN/plugins/scroll-bar.html#%E7%A4%BA%E4%BE%8B
    // http://ustbhuangyi.github.io/better-scroll/doc/zh-hans/options.html#bounce

   setTimeout(()=>{
    new BScroll('.wrapper',{
        click: true,
        scrollY: true,//这是代表的纵向滚动
        scrollbar:false,
        bounce:false
    })

   },500)
 
  

    

 
  
</script>
<style>
    *{
        margin: 0;
        padding: 0;
    }
    .wrapper{
        width: 90%;
        height:300px;
        background-color: aqua;
        overflow: hidden;     
    }
    .content{
       /* position: relative; */
       /* height: 160px; */
       width: 100%;
       overflow-y: scroll;
    }
    .content li{
       /* display: block; */
       /* position: absolute; */
       width: 100%;
       height: 50px;
       line-height: 50px;
       background-color: azure;
       padding: 0;
       border-bottom: 1px solid red;
       box-sizing: border-box;
       text-align: center;
     
    }
</style>
</html>